Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation updates #832

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open

Aggregation updates #832

wants to merge 45 commits into from

Conversation

StepanBrychta
Copy link
Contributor

@StepanBrychta StepanBrychta commented Nov 25, 2024

What does this change?

wellcomecollection/platform#5825

Changes how we handle aggregations in Elasticsearch queries, following on changes to the catalogue pipeline.

The API now supports two aggregation types:

  • Labelled ID aggregations: Consist of an ID-based terms aggregation with a label-based sub-aggregation to retrieve all labels associated with a given ID.
  • Label-only aggregations: Consist of a label-based terms aggregation with no sub-aggregation. Included to keep supporting label-based concept aggregations until we switch to ID-based aggregations/filters.

All existing production functionality should remain the same. From the frontend's perspective, the only change to the API involves renaming ID-based filters (genres.conceptsgenres), but the affected filters are only used behind a feature flag.

Note

This branch has been rebased to #829.

Checklist

How to test

How can we measure success?

Added support for ID-based aggregations without negative side effects and without losing support for label-based concept aggregations.

Have we considered potential risks?

@StepanBrychta StepanBrychta force-pushed the Aggregation-updates branch 2 times, most recently from b0a6815 to 55ed86f Compare December 2, 2024 09:40
@StepanBrychta StepanBrychta force-pushed the Aggregation-updates branch 2 times, most recently from 747b1de to 5cd04a4 Compare December 3, 2024 14:41
`source.genres.label`: Option[GenreFilter],
`source.genres.concepts`: Option[GenreConceptFilter],
`source.contributors.agent.label`: Option[ContributorsLabelFilter],
`source.contributors.agent.id`: Option[ContributorsIdFilter],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the use of .id in keeping with principle 1 in the API faceting RFC?

Filters are named by the JSON paths of the identified object that they filter or, if applied to an attribute other than the identifier, the path of that attribute

I would have expected the if filter to just be for example source.contributors.agent, omitting the ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should now be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants